﻿namespace Loong.Admin.Models
{
    public class AjaxResponse : AjaxResponse<object>
    {
        public AjaxResponse()
        {
        }

        public AjaxResponse(bool success)
            : base(success)
        {
        }

        public AjaxResponse(object? result)
            : base(result)
        {
        }
    }

    public class AjaxResponse<TResult> : AjaxResponseBase
    {
        public TResult? Data { get; set; }

        public object? Error { get; set; }

        public AjaxResponse()
        {
            Success = true;
        }

        public AjaxResponse(TResult? data)
        {
            Data = data;
            Success = true;
            Message = "操作成功";
        }

        public AjaxResponse(bool success)
        {
            Success = success;
        }
    }
}